import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//一般车辆配件类型保修期维护-主机厂
//一般车辆配件类型保修期维护-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPCommonPt/getListByPage`,  params );
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPCommonPt/saveOne`,  params );
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMFAC}/rPCommonPt/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMFAC}/rPCommonPt/updateEnableByIds`,  null ,{params : data} );
//一般车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPCommonPt/updateByPtId`,  params );
//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPCommonPt/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPCommonPt/getListForExport`, params, {
    responseType: 'blob'
  });

  export const getPartType = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getBaseDataByType`, {params});
export const getTjdetail = params =>
  axios.get(`${SERVER.CLAIMFAC}/rPCommonPt/selectById`, {
    params
  });
  //下载中心导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);


// 车系
export const getCarSeries = params => axios.get(`${SERVER.CLAIMFAC}/rPCommonPt/seriesSelect`);
